.class public Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;
.super Lcom/bitauto/autoeasy/tool/ArrayListAdapter;
.source "NewsAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/bitauto/autoeasy/tool/ArrayListAdapter",
        "<",
        "Lcom/bitauto/autoeasy/news/Object/News;",
        ">;"
    }
.end annotation


# instance fields
.field TAG:Ljava/lang/String;

.field private flag:I


# direct methods
.method public constructor <init>(Landroid/app/Activity;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 41
    invoke-direct {p0, p1}, Lcom/bitauto/autoeasy/tool/ArrayListAdapter;-><init>(Landroid/app/Activity;)V

    .line 22
    const-string v0, "BrandListAdapter"

    iput-object v0, p0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;->TAG:Ljava/lang/String;

    .line 25
    const/4 v0, -0x1

    iput v0, p0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;->flag:I

    .line 43
    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 6
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 48
    move-object v3, p2

    .line 51
    .local v3, root:Landroid/view/View;
    if-nez v3, :cond_0

    .line 52
    iget-object v4, p0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;->mContext:Landroid/app/Activity;

    invoke-virtual {v4}, Landroid/app/Activity;->getLayoutInflater()Landroid/view/LayoutInflater;

    move-result-object v1

    .line 53
    .local v1, inflater:Landroid/view/LayoutInflater;
    const v4, 0x7f030004

    const/4 v5, 0x0

    invoke-virtual {v1, v4, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v3

    .line 54
    new-instance v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;-><init>(Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;)V

    .line 56
    .local v0, holder:Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;
    const/high16 v4, 0x7f0b

    invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    iput-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->title:Landroid/widget/TextView;

    .line 57
    const v4, 0x7f0b0003

    invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    iput-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->date:Landroid/widget/TextView;

    .line 58
    const v4, 0x7f0b0001

    invoke-virtual {v3, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Lcom/bitauto/autoeasy/widget/RemoteImageView;

    iput-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->imageView:Lcom/bitauto/autoeasy/widget/RemoteImageView;

    .line 60
    invoke-virtual {v3, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 65
    .end local v1           #inflater:Landroid/view/LayoutInflater;
    :goto_0
    invoke-virtual {p0, p1}, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/bitauto/autoeasy/news/Object/News;

    .line 66
    .local v2, news:Lcom/bitauto/autoeasy/news/Object/News;
    iget-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->imageView:Lcom/bitauto/autoeasy/widget/RemoteImageView;

    const v5, 0x7f020008

    invoke-virtual {v4, v5}, Lcom/bitauto/autoeasy/widget/RemoteImageView;->setBackgroundResource(I)V

    .line 67
    iget-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->imageView:Lcom/bitauto/autoeasy/widget/RemoteImageView;

    invoke-virtual {v2}, Lcom/bitauto/autoeasy/news/Object/News;->getFirstPicUrl()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Lcom/bitauto/autoeasy/widget/RemoteImageView;->setImageUrl(Ljava/lang/String;)V

    .line 69
    iget-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->title:Landroid/widget/TextView;

    invoke-virtual {v2}, Lcom/bitauto/autoeasy/news/Object/News;->getTitle()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 70
    iget-object v4, v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;->date:Landroid/widget/TextView;

    invoke-virtual {v2}, Lcom/bitauto/autoeasy/news/Object/News;->getModifytime()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 71
    return-object v3

    .line 62
    .end local v0           #holder:Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;
    .end local v2           #news:Lcom/bitauto/autoeasy/news/Object/News;
    :cond_0
    invoke-virtual {v3}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;

    .restart local v0       #holder:Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter$ViewHolder;
    goto :goto_0
.end method

.method public isEnabled(I)Z
    .locals 1
    .parameter "position"

    .prologue
    .line 33
    iget v0, p0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;->flag:I

    if-ne v0, p1, :cond_0

    .line 34
    const/4 v0, 0x0

    .line 36
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public setFlag(I)V
    .locals 0
    .parameter "flag"

    .prologue
    .line 28
    iput p1, p0, Lcom/bitauto/autoeasy/news/Adapter/NewsAdapter;->flag:I

    .line 29
    return-void
.end method
